package model
{
	import controller.GameController;
	
	import event.GameEvent;
	
	import flash.data.SQLConnection;
	
	import mx.collections.ArrayCollection;
	import mx.messaging.Consumer;
	import mx.messaging.Producer;
	import mx.rpc.remoting.mxml.RemoteObject;

		[Bindable]
		public class ModelLocator
		{
			private static var modelLocator:model.ModelLocator;
			
			public static function getInstance():ModelLocator
			{
				if (modelLocator == null)
				{
					modelLocator=new ModelLocator();				
				}
				
				return modelLocator;
			}
			
			public function ModelLocator()
			{
				if (ModelLocator.modelLocator != null)
					throw new Error("SÃ³ um exemplo de ModelLocator deveria ser instanciado");
			}
			public var gameEvent:GameEvent;
			public var ro:RemoteObject;
			public var consumer:Consumer;
			public var consumerChat:Consumer;
			public var producer:Producer;
			public var inicia:int=0;
			
			public var idUser:int;
			public var mesa:int;
			public var vira:String;
			public var jogador:Jogador;
			public var usuarioVez:String;
			public var usuarioVezAvatar:Class;
			public var idUsuarioVez:int;
			public var habilitaMesa:Boolean;
			public var rodada:int;
			public var pVoce:int;
			public var pAdver:int;
			public var valorRodada:int=1;
			public var labelNextRodada:String="Truco";
			public var isRecording:Boolean;
			public var userTrucada:int;
			public var statusTruco:String;
			public var userNaoTrucando:Boolean=true;
			public var gameController:GameController;
			public var oponente:Jogador;
			
			
			//mesas
			public var mesasAguardando:ArrayCollection=new ArrayCollection();
			public var numeroView:int=0;
			
			public var historyChat:String="";
			
			public var sqlConnection:SQLConnection;
			
		}
}